import {FormRuleUtil} from "@/utils";


// 角色表单
export const ROLE_EDIT = {
    BODY: {
        apiTokens: [],
        code: "",
        description: "",
        menuIds: [],
        name: "",
        accountType: '',
    },
    RULES: {
        code: FormRuleUtil.strRule("角色代码", true, 8),
        name: FormRuleUtil.strRule("角色名称", true, 8),
        description: FormRuleUtil.strRule("角色描述", false, 200),
        accountType: FormRuleUtil.strRule("适用账号类型", true, 20),
        menuIds: FormRuleUtil.arrayRule("角色菜单ID集合", true),
        apiTokens: FormRuleUtil.arrayRule("角色功能集合", true),
    },
}


// 角色表单

export const ACCOUNT_EDIT = {
    BODY: {
        deptCode: "",
        email: "",
        name: "",
        phoneNumber: "",
        qq: "",
        account: '',
        roleCodes: [],
        sex: "MAN",
        state: "NORMAL",
        wechat: "",
        dataScope: {organCodes: [], scopeType: "ALL"},
        accountType: 'WORKER',
        organ: {code: null},
        dept: {code: null},
    },
    RULES: {
        account: FormRuleUtil.strRule("登录账号", true, 20, 'code'),
        name: FormRuleUtil.strRule("人员姓名", true, 20),
        deptCode: FormRuleUtil.strRule("所属部门", true, 20),
        sex: FormRuleUtil.strRule("人员性别", true, 20),
        state: FormRuleUtil.strRule("人员状态", true, 20),
        phoneNumber: FormRuleUtil.strRule("联系电话", true, 20, 'mobile'),
        email: FormRuleUtil.strRule("电子邮箱", false, 15, 'email'),
        qq: FormRuleUtil.strRule("QQ号码", false, 20, 'qq'),
        wechat: FormRuleUtil.strRule("微信号码", false, 20, 'code'),
        roleCodes: FormRuleUtil.arrayRule("分配角色", true),
        accountType: FormRuleUtil.strRule("账号类型", true, 20),
        organ: {code: FormRuleUtil.strRule("所属机构", true, 30)},
        dept: {code: FormRuleUtil.strRule("所属部门", true, 30)},
        dataScope: {
            organCodes: FormRuleUtil.arrayRule("授权机构明细不能为空", true) ,
            scopeType: FormRuleUtil.strRule("数据授权范围类型不能为空", true, 30)
        },
    },
}